php forum
php mysql forum
php mysql smarty
 
Topic Options
#317034 - 05/21/08 08:21 AM [7.3] Copy/Paste message id for easy merging
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
I hate manually having to copy/paste message id's for the merge function in ubb.threads. So I've made a little copy/paste thingy.

As soon as you edit a post, the current message id is written to a cookie. If you go into the move/merge screen, that id is put into the Merge topic with Post# field.

Let's go to work!

open /scripts/editpost.inc.php

find
Code:
	// ---------------------------------------------------------------------------
	// For security purposes we need to verify that this is user made this post or
	// if they are an admin or a moderator for this board.


Just above it add:

Code:
	// -------------------------------------------
	// Writes a cookie with the current message id
	
	$html->ubbt_setcookie("lasteditnumber",$Number);


Open /scripts/movethread.inc.php

Find:
Code:
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars


Just below it add:
Code:
	$lasteditnumber = get_input("lasteditnumber","cookie");


Find:
Code:
		"days" => $days,


Add below:
Code:
		"lasteditnumber" => $lasteditnumber,


open /templates/default/movethread.inc.php

Find:
Code:
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" />


replace with:
Code:
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="merge" size="10" class="form-input" value="{$lasteditnumber}" />


----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------

open /templates/default/inline_move.tpl

find:
Code:
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" />


replace with:
Code:
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" value="{$lasteditnumber}" />


open /scripts/inline_moderation.inc.php
find:
Code:
function _inline_move() {
	global $config, $dbh, $ubbt_lang, $html, $in, $userob;


Just below add:
Code:
	$lasteditnumber = get_input("lasteditnumber","cookie");


find:
Code:
		'totalposts' => $total_posts,
		'is_gallery' => $is_gallery,
	);

	$cfrm = make_ubb_url("ubb=cfrm", "", false);
	return array(
		"header" => array (
			"title" => $ubbt_lang['CONFIRM_MOVE'],
			"refresh" => 0,
			"javascript" => array(),
			"bypass" => "",
			"onload" => "",
			"breadcrumb" => <<<BREADCRUMB
 <a href="{$cfrm}">{$ubbt_lang['FORUM_TEXT']}</a> &raquo; {$ubbt_lang['CONFIRM_MOVE']}
BREADCRUMB


Add before:
Code:
		"lasteditnumber" => $lasteditnumber,


Anything under the big line in this post you can skip if you don't want the feature enabled in inline moderation!
_________________________

Top
#317056 - 05/23/08 02:46 PM Re: [7.3] Copy/Paste message id for easy merging [Re: blaaskaak]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Nice, helpful moderating mod thumbsup
_________________________
- Allen wavey
- What Drives You?

Top
#317058 - 05/23/08 05:27 PM Re: [7.3] Copy/Paste message id for easy merging [Re: AllenAyres]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
[good mod] wink
_________________________

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks